﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.IO;
using DevExpress.XtraPdfViewer;
using DevExpress.Pdf;


namespace QLNSClient
{
    public partial class XtraFormPdfViewer : DevExpress.XtraEditors.XtraForm
    {

        public XtraFormPdfViewer()
        {
            InitializeComponent();
        }
        public XtraFormPdfViewer(string name):this()
        {
           
            pdfViewer1.LoadDocument(name);
            pdfViewer1.ZoomMode = PdfZoomMode.Custom;
            pdfViewer1.Refresh();
        }


        public XtraFormPdfViewer(byte[] pdf):this()
        {
            
            MemoryStream ms = new MemoryStream(pdf);
          
            //ms.Seek(0, System.IO.SeekOrigin.Begin);
            pdfViewer1.LoadDocument(ms);
            pdfViewer1.ZoomMode = PdfZoomMode.Custom;
            pdfViewer1.Refresh();
        }

        

        private void XtraFormPdfViewer_Load(object sender, EventArgs e)
        {
            
        }

        private void  pdfViewer1_Load(object sender, EventArgs e)
        {
            
        }
    }
}